package threadLearn;

public class demon3 {
    public static void main(String[] args) throws InterruptedException {
        Thread mainThread=Thread.currentThread();
        Thread thread=new Thread(()->{
            System.out.println("thread线程开始等待");
            try {
                mainThread.join();
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("thread线程等待结束");
        });
        thread.start();
        Thread.sleep(2000);
        System.out.println("mian线程结束");
    }



}
